require(["common", "jQuery", "coAjax", "queryString", "hash_routie"], function(jSouper, $, coAjax, QueryString, hash_routie) {
	//清空缓存
	hash_routie.on("shelves", function() {
		App.set('title', '访客信息');
		_get_visitorInfo_data();
	});

	function _get_visitorInfo_data() {
		coAjax.get(appConfig.bus.visitor_statistical, {
			num: 20
		}, function(result) {
			App.set("$Cache.bus.visitor.total_number", result.result.total_number);
			var visitor_statistical = result.result.statistical;
			App.set("$Cache.bus.visitor.statistical", visitor_statistical);
			jSouper.forEach(visitor_statistical, function(item, index) {
				if (!item.ip_info_detail) {
					coAjax.get(appConfig.bus.ip + item.ip, function(data) {
						var ip_info = data.result.data;
						item.ip_info_detail = ip_info.city;
						App.getModel().touchOff("$Cache.bus.visitor.statistical." + index);
					});
				}
			});
		});
	}
})